<template>
  <div>
    <div class="title border-bottom">热销推荐</div>
    <ul>
      <li class="item" v-for="i of recommendList " :key="i.id">
        <img class="item-img" :src="i.imgUrl">
        <div class="item-infos">
          <p class="item-info">{{i.title}}</p>
          <p class="item-title">{{i.info}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'recommend',
  props: {
    recommendList: Array,
  },
  data() {
    return {
    };
  },
};
</script>

<style scoped>
.title{
  margin-top: 5px;
  line-height: 40px;
  background: #cccccc;
  text-indent: 10px;
}
.item{
  display: flex;
  height: 65px;
}
.item-img{
  height: 60px;
  width: 60px;
  padding: 2px;
}
.item-infos{
  flex: 1;
  padding: 1px;
  min-width: 0;
}
.item-title{
  font-size: 10px;
  line-height: 10px;
  color: #cccccc;
  /*下面三个用样式控制文字多了隐藏*/
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.item-info{
  font-size: 15px;
  line-height: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.item-button{
  color:#fff;
  padding: 1px;
  border-radius: 0.5px;
  background: #ff9300;
}
</style>
